<template>
  <component :is="remote" v-if="remote" />
</template>
<script>
import { loadScript } from "./load.js";
export default {
  name: "LazyComponent",
  props: {
    src: {
      type: String,
      required: true
    }
  },
  data() {
    return {
      remote: null
    };
  },
  async mounted() {
    this.remote = await loadScript(this.src);
  }
};
</script>